let timer;

function startTimer() {
    timer = setInterval(() => {
        console.log(window.ENVIRONMENT_PRINT_ID);
        
        if (window.ENVIRONMENT_PRINT_ID != undefined) {
            clearInterval(timer);
            try {
                let data = {
                    action: 'web_first',
                    ENVIRONMENT_PRINT_ID: window.ENVIRONMENT_PRINT_ID
                }
                chrome.runtime.sendMessage(data, function (response) {
                    if (response) {
                    }
                });
            } catch (err) {
                // console.log(err);
            }
        }
    }, 1000);
}

setTimeout(() => {
    // startTimer();
}, 1000);

